]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st: Do not try to unref NULL CoglObjects
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 14 Apr 2016 15:18:42 +0000 (17:18 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 15 Apr 2016 16:22:18 +0000 (18:22 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=765061

src/st/st-private.c
src/st/st-texture-cache.c

index d40eceb86c78a2fc2a39578b99c5f865faa26bf7..e5a27019b77c37b3c844401c9d970eb7066851d2 100644 (file)
@@ -395,7 +395,10 @@ _st_create_shadow_pipeline (StShadow    *shadow_spec,
 
   pipeline = cogl_pipeline_copy (shadow_pipeline_template);
   cogl_pipeline_set_layer_texture (pipeline, 0, texture);
-  cogl_object_unref (texture);
+
+  if (texture)
+    cogl_object_unref (texture);
+
   return pipeline;
 }
 
index 88c6bf3ec306cc535c626b953f8c11b0ff494078..cec97d538e0f64dd148473fc73d50f6a541f83b4 100644 (file)
@@ -640,8 +640,12 @@ st_texture_cache_reset_texture (StTextureCachePropertyBind *bind,
                                                              cairo_image_surface_get_stride (surface),
                                                              cairo_image_surface_get_data (surface),
                                                              NULL));
-      clutter_texture_set_cogl_texture (bind->texture, texdata);
-      cogl_object_unref (texdata);
+
+      if (texdata)
+        {
+          clutter_texture_set_cogl_texture (bind->texture, texdata);
+          cogl_object_unref (texdata);
+        }
 
       clutter_actor_set_opacity (CLUTTER_ACTOR (bind->texture), 255);
     }